<!--待审议名单导出-->
<template>
    <el-main>
        <el-main class="ep-body">
            <el-card class="ep-card">
                <el-form :model="form" :rules="rules" >
                    <el-row :gutter="10">
                        <ep-date  colspan="8" label="鉴定日期" name="bae561" :property="form.bae561" format="yyyyMM" value-format="yyyyMM"
                                  p="E"   :datas="{formData :form}" ></ep-date>
                        <ep-input  label="统筹区" name="aaa027" :property="form.aaa027"
                                   colspan="8"     p="E"   :datas="{formData :form}" ></ep-input>
                        <ep-button  api="doQuery"  type="primary"
                                    :datas="{formData: form}"
                                    name="查询"></ep-button>
                        <ep-button id="" api="doChange"  type="primary"
                                   :datas="{tableData:tableData}"
                                   name="导出"></ep-button>
                    </el-row>
                </el-form>
            </el-card>

            <el-card class="ep-card">
                <el-row>
                    <ep-table :data="tableData" border style="width: 100%;" >
                        <el-table-column type="selection" width="55"></el-table-column>
                        <el-table-column sortable prop="no" label="序号"></el-table-column>
                        <el-table-column sortable prop="bae506" label="鉴定申报编号"></el-table-column>
                        <el-table-column sortable prop="aac001" label="人员id"></el-table-column>
                        <el-table-column sortable prop="aac147" label="身份证号"></el-table-column>
                        <el-table-column sortable prop="aac003" label="姓名"></el-table-column>
                        <el-table-column sortable prop="aac067" label="手机号码"></el-table-column>
                        <el-table-column sortable prop="aab001" label="单位id"></el-table-column>
                        <el-table-column sortable prop="aab004" label="单位名称"></el-table-column>
                        <el-table-column sortable prop="aae006" label="单位地址"></el-table-column>
                        <el-table-column sortable prop="aae004" label="单位联系人"></el-table-column>
                        <el-table-column sortable prop="aae005" label="单位联系电话"></el-table-column>
                        <el-table-column sortable prop="alc020" label="伤病日期"></el-table-column>
                        <el-table-column sortable prop="baz506" label="专家鉴定id"></el-table-column>
                        <el-table-column sortable prop="aae013" label="专家结论"></el-table-column>
                        <el-table-column sortable prop="alc034" label="专家鉴定时间"></el-table-column>
                        <el-table-column sortable prop="alc022" label="受伤部位"></el-table-column>
                        <el-table-column sortable prop="blc504" label="分科类别"></el-table-column>
                        <el-table-column sortable prop="aae127" label="申请日期"></el-table-column>
                        <el-table-column sortable prop="bae508" label="鉴定事项"></el-table-column>
                    </ep-table>
                </el-row>
            </el-card>

        </el-main>

    </el-main>
</template>
<script type="es6">
    export default {
        data() {
            return {
                form:{
                    bae561: {
                        value: '',
                        p: 'E'
                    },
                    aaa027: {
                        value: '',
                        p: 'E'
                    },

                },
                tableData: {},

                rules:{

                },
                codeTypes:{

                },
                pager: {
                    page: 1,
                    size: 10
                },
                total: 0,
            }
        },
        computed: {
            functionId() {
                if (this.$store.getters.init.path !== this.$route.path) return;
                if (this.$store.getters.init.mdParam === null || this.$store.getters.init.mdParam === undefined) return;
                if (this.$store.getters.init.mdParam.functionid === undefined) return;
                return this.$store.getters.init.mdParam.functionid;
            },
            backFun() {
                return this.$store.getters.backFun;
            },
            init_formData() {
                if (this.$store.getters.init.path !== this.$route.path)  return;
                return this.$store.getters.init.form;
            },
            doInitformData: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.formData;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
            init_tableData() {
                return this.$store.getters.init.tableData;
            },
            doInittableData: {
                get: function () {
                    if (this.$store.getters.init === null) return [];
                    if (this.$store.getters.init.path !== this.$route.path) return;
                    return this.$store.getters.init.tableData;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },

        },
        created() {
            let param = {
                path: this.$route.path,
                codeTypes:this.codeTypes,
                form:this.form,
                tableData:this.tableData

            };
            this.$store.dispatch('SET_INIT', param);
        },
        watch: {
            init_formData: {
                handler(value) {
                    if (value == undefined) return;
                    this.getformData(value);
                },
                deep: true
            },
            doInitformData: {
                handler(value) {
                    if (value == undefined) return;
                    this.getformData(value);
                },
                deep: true
            },
            doInittableData: {
                handler(value) {
                    if (value == undefined) return;
                    this.gettableData(value);
                },
                deep: true
            },

            backFun: {
                handler(value) {
                    if (value === null) return;
                    this.customBackFun();
                    let backFun = [];
                    backFun = value.split(',');
                    if (backFun.indexOf('rDoInit') >= 0) {
                        let codeTypes = {

                        };
                        let form = {
                            bae561: {
                                value: '',
                                p: 'E'
                            },
                            aaa027: {
                                value: '',
                                p: 'E'
                            },

                        };
                        let tableData= {};

                        let param = {
                            path: this.$route.path,
                            codeTypes:codeTypes,
                            form:form,
                            tableData:tableData

                        };
                        this.$store.dispatch('SET_INIT', param);
                    }
                }
            }
        },
        methods: {
            getformData(value) {
                this.form = value;
            },
            gettableData(value) {
                this.tableData = value;
            },

            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
            },
            handleEdit(id) {
                this.dialogFormVisible = true;
            },
            customBackFun(){//自定义方法体
            },
        },
    }
</script>
